package com.husd.framework.ch;

public class Char {

    /**
     * Convert an ASCII digit from its base (8, 10, or 16)
     * to its value.
     */
    protected int digit(char ch, int base) {
        char c = ch;
        int result = Character.digit(c, base);
        if (result >= 0 && c > 0x7f) {
            ch = "0123456789abcdef".charAt(result);
        }
        return result;
    }
}
